package com.ruoyi.system.mysql.service;

import com.ruoyi.system.api.domain.SysOperLog;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

@LocalTCC
public interface TCCService {

    @TwoPhaseBusinessAction(name = "mysql-deductInventory", commitMethod = "commit", rollbackMethod = "rollback")
    boolean prepare(@BusinessActionContextParameter(paramName = "operLog") SysOperLog operLog);

    boolean commit(BusinessActionContext context);
    boolean rollback(BusinessActionContext context);
}
